/**
 * 
 */
package com.coder520.sync_learning.demo;

/**
 * @author zhaoyibo
 *
 */
public class DaemonThread {
	public static void main(String[] args) throws InterruptedException {
		Thread thread=new Thread(()->{
			while (true) {
				try {
					Thread.sleep(1);
				} catch (Exception e) {
					// TODO: handle exception
				}
			}
		}) ;
		
		thread.setDaemon(true);
		
		thread.start();
		
		Thread.sleep(2_000L);
		
		System.out.println("main函数结束啦");
	}
}
